//
//  DOPDropDownMenu.h
//  DOPDropDownMenuDemo
//
//  Created by weizhou on 9/26/14.
//  Copyright (c) 2014 fengweizhou. All rights reserved.
//

//#import "TZDatePickerView.h"
//#import "FSCalendar.h"
#import <UIKit/UIKit.h>
@interface DOPIndexPath : NSObject

@property(nonatomic, assign) NSInteger column;
@property(nonatomic, assign) NSInteger row;

- (instancetype)initWithColumn:(NSInteger)column row:(NSInteger)row;
+ (instancetype)indexPathWithCol:(NSInteger)col row:(NSInteger)row;

@end

#pragma mark - data source protocol
@class DOPDropDownMenu;

@protocol DOPDropDownMenuDataSource <NSObject>

@required
- (NSInteger)menu:(DOPDropDownMenu *)menu numberOfRowsInColumn:(NSInteger)column;
- (NSString *)menu:(DOPDropDownMenu *)menu titleForRowAtIndexPath:(DOPIndexPath *)indexPath;
@optional
// default value is 1
- (NSInteger)numberOfColumnsInMenu:(DOPDropDownMenu *)menu;
@end

#pragma mark - delegate
@protocol DOPDropDownMenuDelegate <NSObject>
@optional

-(void)menu:(DOPDropDownMenu *)menu didSelectCalender:(NSString *)calender;
- (void)menu:(DOPDropDownMenu *)menu didSelectRowAtIndexPath:(DOPIndexPath *)indexPath;
- (void)menu:(DOPDropDownMenu *)menu numberOfSectionAtIndexPath:(NSInteger)section;

@end

#pragma mark - interface
@interface DOPDropDownMenu : UIView <UITableViewDataSource, UITableViewDelegate>

@property(nonatomic, weak) id<DOPDropDownMenuDataSource> dataSource;
@property(nonatomic, weak) id<DOPDropDownMenuDelegate> delegate;

@property(nonatomic, strong) UIColor *indicatorColor;
@property(nonatomic, strong) UIColor *textColor;
@property(nonatomic, strong) UIColor *textSelColor;
@property(nonatomic, strong) UIColor *separatorColor;
@property(nonatomic, assign) int mostRowNum; //显示最多行数。默认5行


@property(nonatomic, assign) BOOL isAddOtherView;//是否使用其他界面替换下拉菜单
//替换下拉菜单的其他界面
/*格式
 @{@"columnNum1":view1,@"columnNum2":view2};
 */
@property(nonatomic, strong) NSDictionary * otherView;

@property(nonatomic, assign) BOOL isCutOffLine;//是否显示column 之间的分割线
@property(nonatomic, assign) BOOL isNotShowArrow;//是否不显示箭头
@property(nonatomic, assign) BOOL isDoubleBottomLine;//底部线的长度

@property(nonatomic, assign) BOOL isUnAverageWight;//是不是均等分 默认0-是均等
@property(nonatomic, assign) int isUnAverageNum;//不是均等分的位置。从0开计算

@property(nonatomic, strong) UIColor* columnTextColor;//标题颜色
@property(nonatomic, strong) UIColor* rowTextSelColor;//菜单cell选择颜色
@property(nonatomic, strong) UIColor* rowTextUnSelColor;//菜单cell未选中颜色
@property(nonatomic, strong) UIColor* rowCellSelColor;//菜单cell背景选中颜色
@property(nonatomic, strong) UIColor* rowCellUnSelColor;//菜单cell背景未选中颜色



////日历
//@property (strong, nonatomic) FSCalendar *calendar;


/**
 *  the width of menu will be set to screen width defaultly
 *
 *  @param origin the origin of this view's frame
 *  @param height menu's height
 *
 *  @return menu
 */
- (instancetype)initWithOrigin:(CGPoint)origin andHeight:(CGFloat)height;
- (NSString *)titleForRowAtIndexPath:(DOPIndexPath *)indexPath;
- (void)dismiss;
//修改指定section的显示Str
-(void)changeTitleStr:(NSString *)showStr sention:(NSInteger)sention;
@end
